@echo off
set JAVA_HOME=C:\Program Files\Java\jdk-21
set M2=%USERPROFILE%\.m2\repository
set CP=target\classes

REM Spring Boot and Core Dependencies
set CP=%CP%;%M2%\org\springframework\boot\spring-boot-starter-web\2.7.18\spring-boot-starter-web-2.7.18.jar
set CP=%CP%;%M2%\org\springframework\boot\spring-boot-starter\2.7.18\spring-boot-starter-2.7.18.jar
set CP=%CP%;%M2%\org\springframework\boot\spring-boot\2.7.18\spring-boot-2.7.18.jar
set CP=%CP%;%M2%\org\springframework\boot\spring-boot-autoconfigure\2.7.18\spring-boot-autoconfigure-2.7.18.jar

REM Spring Framework Core
set CP=%CP%;%M2%\org\springframework\spring-core\5.3.23\spring-core-5.3.23.jar
set CP=%CP%;%M2%\org\springframework\spring-context\5.3.23\spring-context-5.3.23.jar
set CP=%CP%;%M2%\org\springframework\spring-beans\5.3.23\spring-beans-5.3.23.jar
set CP=%CP%;%M2%\org\springframework\spring-web\5.3.23\spring-web-5.3.23.jar
set CP=%CP%;%M2%\org\springframework\spring-webmvc\5.3.23\spring-webmvc-5.3.23.jar
set CP=%CP%;%M2%\org\springframework\spring-jcl\5.3.23\spring-jcl-5.3.23.jar

REM Additional Spring Dependencies
set CP=%CP%;%M2%\org\springframework\spring-aop\5.3.23\spring-aop-5.3.23.jar
set CP=%CP%;%M2%\org\springframework\spring-expression\5.3.23\spring-expression-5.3.23.jar
set CP=%CP%;%M2%\org\springframework\spring-oxm\5.3.23\spring-oxm-5.3.23.jar
set CP=%CP%;%M2%\org\springframework\spring-tx\5.3.23\spring-tx-5.3.23.jar

REM Apache Tomcat
set CP=%CP%;%M2%\org\apache\tomcat\embed\tomcat-embed-core\9.0.78\tomcat-embed-core-9.0.78.jar
set CP=%CP%;%M2%\org\apache\tomcat\embed\tomcat-embed-el\9.0.78\tomcat-embed-el-9.0.78.jar
set CP=%CP%;%M2%\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.78\tomcat-embed-websocket-9.0.78.jar

REM Jackson
set CP=%CP%;%M2%\com\fasterxml\jackson\core\jackson-databind\2.15.3\jackson-databind-2.15.3.jar
set CP=%CP%;%M2%\com\fasterxml\jackson\core\jackson-core\2.15.3\jackson-core-2.15.3.jar
set CP=%CP%;%M2%\com\fasterxml\jackson\core\jackson-annotations\2.15.3\jackson-annotations-2.15.3.jar

REM Logging
set CP=%CP%;%M2%\org\apache\logging\log4j\log4j-api\2.17.2\log4j-api-2.17.2.jar
set CP=%CP%;%M2%\org\apache\logging\log4j\log4j-core\2.17.2\log4j-core-2.17.2.jar
set CP=%CP%;%M2%\org\apache\logging\log4j\log4j-slf4j2-impl\2.17.2\log4j-slf4j2-impl-2.17.2.jar
set CP=%CP%;%M2%\org\slf4j\slf4j-api\1.7.36\slf4j-api-1.7.36.jar

REM Run the application with specified port
"%JAVA_HOME%\bin\java.exe" -cp "%CP%" -Dserver.port=1234 com.example.deepseek.backend.DeepSeekBackendApplication
pause